<template>
  <div>
   <h1>会员登录</h1>
   <table>
    <tbody>
      <tr>
        <td>账号</td>
        <td>
          <input type="text" v-model="info.usecnae">
        </td>
      </tr>

      <tr>
        <td>密码</td>
        <td>
          <input type="password" v-model="info.Userpwd">
        </td>
      </tr>

      <tr>
        <td></td>
        <td>
          <input type="button" value="登录" @click="Login">
        </td>
      </tr>
    </tbody>
   </table>
  </div>
</template>

<script setup lang="ts">
import {ref,reactive,onMounted} from 'vue';
import axios from 'axios'
import { useRoute,useRouter } from 'vue-router';
import { couldStartTrivia } from 'typescript';
let route=useRoute();
let router=useRouter()

const info=reactive({
  usecnae:"",
  Userpwd:""
})
const Login=()=>{
  axios.post("https://localhost:7177/api/Fx/Login",info)
   .then(res=>{
       if(res.data==-1)
       {      
        alert('登录成功');
        router.push('/fxzjia');  
       }
     
       else{
       
          alert('登录失败');
          return;
       }
   })
}
</script>

<style scoped>

</style>